package com.eian.boot.module.common.model.dto;

import com.eian.boot.common.id.enums.IdContentType;
import com.eian.boot.common.id.enums.IdTemplateType;
import com.eian.boot.common.id.model.PadPosition;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 批量生成ID请求（自定义配置）
 *
 * @author alex.meng
 * @createTime 2025-10-15
 */
@Data
@Schema(description = "批量生成ID请求（自定义配置）")
public class BatchGenerateByConfigRequest {

    @Schema(description = "业务类型标识（号段/序列号模式必填）", example = "card_key")
    private String bizType;

    @NotNull(message = "ID内容类型不能为空")
    @Schema(description = "ID主体内容类型", example = "UUID")
    private IdContentType contentType;

    @Schema(description = "前缀模板类型", example = "FIXED")
    private IdTemplateType prefixTemplate = IdTemplateType.FIXED;

    @Schema(description = "固定前缀值", example = "CK")
    private String prefix;

    @Schema(description = "后缀模板类型", example = "FIXED")
    private IdTemplateType suffixTemplate = IdTemplateType.FIXED;

    @Schema(description = "固定后缀值", example = "")
    private String suffix;

    @Schema(description = "补位字符", example = "0")
    private Character padChar = '0';

    @Schema(description = "ID总长度（不包括前后缀）", example = "16")
    private Integer idLength = 0;

    @Schema(description = "补位位置", example = "LEFT")
    private PadPosition padPosition = PadPosition.LEFT;

    @Schema(description = "是否使用混淆", example = "false")
    private Boolean useObfuscate = false;

    @NotNull(message = "生成数量不能为空")
    @Min(value = 1, message = "生成数量至少为1")
    @Max(value = 100000, message = "单次生成数量不能超过100000")
    @Schema(description = "生成数量", example = "100")
    private Integer count;

    @Schema(description = "是否去重", example = "false")
    private Boolean unique = false;
}

